package com.shenyong.ladmin.service.Impl;

import com.shenyong.ladmin.entity.Advertising;
import com.shenyong.ladmin.mapper.AdvertisingMapper;
import com.shenyong.ladmin.result.Page;
import com.shenyong.ladmin.service.AdvertisingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author
 * @site
 * @company
 * @create
 */
@Service
public class AdvertisingServiceImpl implements AdvertisingService{
    @Autowired
    private AdvertisingMapper advertisingMapper;
    @Override
    public Map<String,Object> getAdverPage(Page page) {
        Map<String,Object> map=new HashMap<String,Object>();
        map.put("code",0);
        map.put("msg","");
        map.put("count",advertisingMapper.getAdverCount(page));
        map.put("data",advertisingMapper.getAdverPage(page));
        return map;
    }

    @Override
    public int AdverUpdate(Advertising advertising) {
        return advertisingMapper.AdverUpdate(advertising);
    }

    @Override
    public int AdverInsert(Advertising advertising) {
        return advertisingMapper.AdverInsert(advertising);
    }

    @Override
    public int Adverdelete(int id) {
        return advertisingMapper.Adverdelete(id);
    }

    @Override
    public int updateImage(Advertising advertising) {
        return advertisingMapper.updateImage(advertising);
    }

    @Override
    public List<Advertising> selectAll() {
        return advertisingMapper.selectAll();
    }
}
